{% extends 'TopxiaAdminBundle::layout.html.twig' %}

{% set menu = 'admin_login_record' %}

{% set script_controller = 'login-record/list' %}

{% block main %}

<div class="well well-sm">
  <form id="login-record-search-form" class="form-inline" action="" method="get" novalidate> 
    
    {% include 'OrgBundle:Org:org-tree-select.html.twig' with {orgCode: app.request.get('orgCode'), modal: 'list'} %}
    
    <div class="form-group controls">
      <select id="keywordType" name="keywordType" class="form-control">
        {{ select_options(dict('userKeyWordTypes'), app.request.query.get('keywordType')) }}
      </select>
    </div>

    <div class="form-group">
      <input type="text" id="keyword" name="keyword" class="form-control" value="{{ app.request.query.get('keyword') }}" placeholder="关键词">
    </div>

    <div class="form-group">
        <input class="form-control" type="text" id="startDate" name="startDateTime" value="{{app.request.query.get('startDateTime')}}" placeholder="{{'起始时间'|trans}}">
    </div>

    <div class="form-group">
        <input class="form-control" type="text" id="endDate" name="endDateTime" value="{{app.request.query.get('endDateTime')}}" placeholder="{{'结束时间'|trans}}">
    </div>
    <span></span>

    <button class="btn btn-primary">{{'搜索'|trans}}</button>
  </form>
</div>

<table id="teacher-table" class="table table-striped table-hover" data-search-form="#user-search-form">
  <thead>
    <tr>
      <th>用户名</th>
      {% include 'OrgBundle:Org/Parts:table-thead-tr.html.twig' %}
      <th>用户邮箱</th>
      <th>登录时间IP</th>
      <th>登录地点</th>
      <th width="12%">查看记录</th>
    </tr>
  </thead>
  <tbody>
    {% for logRecord in logRecords %}
      {% set user = users[logRecord.userId]|default(null) %}
      {% include 'TopxiaAdminBundle:LoginRecord:table-tr.html.twig' with {logRecord:logRecord} %}
    {% endfor %}
  </tbody>
</table>
  {{ web_macro.paginator(paginator) }} 
{% endblock %}